<template>
	<view class="itemLayout" @click="goDetail(item.id)" >
		<view class="right"  v-if="item.images">
			<image :src="item.images" mode="aspectFill"></image>
		</view>
		
		<view class="left">
			<view class="title">{{item.title}}</view>
			<view class="info">
				<view class="item read">
					<uni-icons type="eye"></uni-icons>
					{{item.heat}}
				</view>
				<view class="item read">
					<uni-icons type="chatbubble"></uni-icons>
					{{item.comment}}
				</view>
				<view class="item category">
					<uni-icons type="paperplane"></uni-icons>
					{{item.category ? item.category.cate_name : '推荐'}}
				</view>
			</view>
		</view>
	
	</view>
</template>

<script setup>
	import {
		ref
	} from 'vue'
	defineProps(['item'])
	let showModel = ref(false)
	const goDetail = (id) => {
		
		uni.navigateTo({
			url: '/pages/article/detail?id=' + id
		})
	}
	const doAct = () => {

	}
</script>

<style scoped lang="scss">
	.itemLayout {
		display: flex;
		width: 100%;
		height: 155rpx;
		display: flex;
		align-items: center;
		margin: 20rpx 0;
		background-color: #f9fafb;
		margin-bottom: 20rpx;
		padding: 10rpx;
		border-radius: 20rpx;
		position: relative;
		
		.left {
			flex: 1;
			width: 30%;
			margin-left: 20rpx;
			.title {
				color: #000;
				white-space: nowrap;
				overflow: hidden;
				text-overflow: ellipsis;
				margin-bottom: 20rpx;
			}

			.info {
				display: flex;
				line-height: 38rpx;

				.item {
					display: flex;
					align-items: center;
					font-size: 20rpx;
					color: #7d8390;
					margin-right: 30rpx;
				}

			}
		}

		.right {
			width: 155rpx;
			height: 155rpx;
			margin-left: 20rpx;

			image {
				width: 100%;
				height: 100%;
				border-radius: 10rpx;
			}
		}
	}
</style>